import { fileURLToPath, URL } from 'node:url'
 
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
  ],
  resolve: {
    alias: {
      //访问别名 使用src下的文件/文件夹 ，按照@/文件夹/文件后的格式引入，即可访问
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  css: {
    preprocessorOptions: {
      less: {
        modifyVars: {
          // 全局less样式
          hack: 'true; @import "@/assets/less.less"'
        },
        javascriptEnabled: true
      }
    }
  },
  server: {
    proxy: {
      '/proxyApi': {
        target: 'http://116.198.244.137:8012/',
        // target: 'http://127.0.0.1:8012/',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/proxyApi/, ''),
      },
      
    }
  },
})
 
